package com.cljh.mapper;

import com.cljh.bean.Article;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ArticleMapper {
    List<Article> selectAllByCondition(@Param("begin") Integer begin, @Param("size") Integer size, @Param("article") Article article);
    /**
     * TODO
     *
     * @param article
     * @return
     */

    int save(@Param("article") Article article);




    /**
     *
     * @param article
     * @return
     */
    int update(@Param("article") Article article);


    int selectByCount(@Param("article") Article article);

    int deleteByIds(@Param("ids") List<Integer> ids);

    @Delete("delete from mtmall_test.article where id=#{id};")
    int deleteById(@Param("id") Integer id);



    Article selectById(Integer id);


    @Select("select * from mtmall_test.article;")
    List<Article> ArticleList();



    List<Article> selectByAdmin(Integer id);




}
